
import java.awt.Canvas;
import java.awt.Graphics;


public class Dibujo extends Canvas{
    private int x1;
    private int y1;
    private int x2;
    private int y2;
    private int clicks;

    public void paint(Graphics g){
        if(clicks==1){
            g.drawOval(x1-10, y1-10, 20, 20);
        }else{
            g.drawOval(x1-10, y1-10, 20, 20);
            g.drawLine(x1, y1, x2, y2);
            
        }
    }

    public void addPunto(int x,int y){
        clicks++;
        if(clicks==1){
            this.x1==x;
            this.y1==y;

        }else{
            this.x2==x;
            this.y2==y;
            clicks==0;
        }
        repaint();


    }

   public static void main(String args[]){
         Dibujo b=new Dibujo();
   }
}
